<?php
	require_once("conexion/conexion.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
<link href="Estilos/global.css" rel="stylesheet" type="text/css" />
<link href="Estilos/local.css" rel="stylesheet" type="text/css" />
<link href="Estilos/CssTabla3.css" rel="stylesheet" type="text/css" />
<link href="Estilos/jquery.autocomplete.css" rel="stylesheet" type="text/css" />

<script src="include_js/jquery.js" type="text/javascript"></script>
<script src="include_js/funciones.js" type="text/javascript"></script>
<script src="include_js/jquery.autocomplete.js" type="text/javascript"></script>
<style>
.texto
{
	font-size:14px;
	margin-left:5px;
	font:Verdana, Arial, Helvetica, sans-serif; 
	color:#0066CC;
}
.asterisco
{
	color:#0000FF;
	font-weight:bold;
}
.Normal
{
border:1px solid #D3E4E5;
}
</style>
<script>
function Llenar(json)
{
	$("#txtTitular").focus().autocomplete(json);
}
$(document).ready(function() 
{
	$.ajax({
			type: 'post',
			dataType: 'json',
			url: "CompletaOtrosCliente.php",
			data: {valor: '1'},
			success: function(json){
				Llenar(json);
			}
		});
});

function BorraDatos(dato)
{
	var cadena = dato.substring(10,11);
	//alert(cadena);
    if(cadena=='1')
	{	
		document.form_otros.submit();
	}
	else
	{
		document.getElementById('txtOrden').focus();
	}
}
</script>
</head>

<body>
<form name="form_otros" id="form_otros" method="post">
<div class='option2'><label style="font:Verdana, Arial, Helvetica, sans-serif; color:#0066CC; font-weight:bold;">Secci&oacute;n Otros Servicios.</label></div>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="uno">
<tr><td class="Normal" colspan="3"><div style="float:right; clear:none; margin-right:10px; 

margin-top:5px;"><label style="color:#0000FF; font-size:12px; font-weight:bold;">Datos 

Obligatorios(*)</label></div></td></tr>
  <tr>
    <td class="Normal" colspan="3"><hr /></td>
  </tr>
  <tr>
    <td class="Normal"><label class="texto">Cliente:</label></td>
    <td class="Normal" colspan="2"><input type="text" name="txtTitular" id="txtTitular" size="60" />&nbsp;<label class="asterisco">*</label></td>
    </tr>
  <tr>
    <td class="Normal"><label class="texto">Tipo:</label></td>
    <td class="Normal"><select name="cmb_tipo" id="cmb_tipo">
	<option value="0">--SELECCIONE--</option>
	<?php
            	$con = new Conexion();
        		$con2 = $con->conexionBD("fpproduccion");
                $sql = "select TOtrosCod,TOtrosNombre from tipootros";
                $resultado = mysql_query($sql) or die ($con->error_mysql("Error en la 

consulta".mysql_error()));
				while ($row = mysql_fetch_row($resultado))
				{
					echo "<option 

value='".$row[0]."'>".$row[1]."</option>";
				}
                $con->cerrarBD();
			  	?>
    </select>&nbsp;<label class="asterisco">*</label></td>
    <td class="Normal">&nbsp;</td>
  </tr>
  <tr>
    <td width="19%" class="Normal"><label class="texto">Titulo:</label></td>
    <td width="45%" class="Normal"><input type="text" name="txtTitulo" id="txtTitulo" size="40" />&nbsp;<label class="asterisco">*</label></td>
    <td width="36%" class="Normal">&nbsp;</td>
    </tr>
  
  <tr>
    <td class="Normal"><label class="texto">N&deg; Orden:</label></td>
    <td class="Normal"><input type="text" name="txtOrden" id="txtOrden" size="40" />&nbsp;<label 

class="asterisco">*</label></td>
    <td class="Normal">&nbsp;</td>
    </tr>
  <tr>
    <td class="Normal"><label class="texto">Responsable:</label></td>
    <td class="Normal"><input type="text" name="txtResponsable" size="40" /></td>
    <td class="Normal">&nbsp;</td>
    </tr>
  <tr>
    <td class="Normal"><label class="texto">Fecha:</label></td>
    <td class="Normal"><input name="txtFechaIni" type="text" id="txtFechaIni" size="10">&nbsp;<img src="imagen/img.gif" width="20" height="14" title="calendario" style="cursor: pointer; border: 1px solid green;" onmouseover="this.style.background='black';" onmouseout="this.style.background=''" onclick="popUpCalendar(txtFechaIni, form_otros.txtFechaIni, 'dd-mm-yyyy');" />
      <label class="asterisco">*</label></td><td class="Normal">&nbsp;</td>
    </tr>
  <tr>
    <td class="Normal"><label class="texto">Localizaci&oacute;n:</label></td>
    <td class="Normal"><input type="text" name="txtLocalizacion" size="40" /></td>
    <td class="Normal">&nbsp;</td>
    </tr>
  <tr>
    <td class="Normal"><label class="texto">Valor ($):</label></td>
    <td class="Normal">
	<input type="text" name="txtPrecio" id="txtPrecio" size="10" onkeyup="puntitos(this,this.value.charAt(this.value.length-1))" />&nbsp;<label class="asterisco">*</label></td>
    <td class="Normal"><div id="mensaje"></div></td>
  </tr>
  <tr>
    <td class="Normal" colspan="3"><hr /></td>
  </tr>
  <tr>
    <td class="Normal">&nbsp;</td>
    <td class="Normal"><input type="button" name="btn_Guardar_Otros" id="btn_Guardar_Otros" value=" " class="guardar" /></td>
    <td class="Normal">&nbsp;</td>
    </tr>
	<tr><td class="Normal" colspan="3">&nbsp;</td></tr>
</table>
</form>
</body>
<script>
$('#btn_Guardar_Otros').click(function() 
{ 
        $.ajax({
            type: 'POST',
            url: 'Produccion/Ingresa_Otros.php',
            data: $('#form_otros').serialize(),
            success: function(data) {
                $('#mensaje').html(data);
				BorraDatos(data);
            }
        })
});
</script>
</html>
